<template>

</template>

<script setup>
import CryptoJS from 'crypto-js';


/**
 * JAVA hutool：
 *
 * private static final AES aes
 * = SecureUtil.aes(SecureUtil.md5().digestHex(API_ENC_SECRET).getBytes(StandardCharsets.UTF_8));
 *
 * String encryptedHex = aes.encryptBase64(JSONObject.toJSONString(list));
 *
 * @param encryptedData
 * @returns {string}
 */
function decryptData(encryptedData) {
  const SECRET_KEY = CryptoJS.enc.Utf8.parse('秘钥');
  const decryptedBytes = CryptoJS.AES.decrypt(encryptedData, SECRET_KEY, {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Pkcs7
  });
  const decryptedData = decryptedBytes.toString(CryptoJS.enc.Utf8);
  return decryptedData;
}

</script>